package com.gusha.model;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Table(name = "farm_operation")
@NamedQuery(name = "FarmOperation.findAll", query = "SELECT f FROM FarmOperation f")
@DynamicInsert
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FarmOperation implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private BigInteger id;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "user_id")
	private User userId;

	
	@Column(name = "op_type")
	private BigInteger opType;//浇水次数
	
	@Column(name = "op_time")
	private Date opTime;//浇水时间
	
	
	@Column(name = "delivery_num")
	private BigInteger deliveryNum;//收货数量
	
	@Column(name = "delivery_time")
	private Date deliveryTime;//收货时间
	
	@Column(name = "shop_type")
	private BigInteger shopType;

	
	
	public BigInteger getShopType() {
		return shopType;
	}

	public void setShopType(BigInteger shopType) {
		this.shopType = shopType;
	}

	public BigInteger getId() {
		return id;
	}

	public void setId(BigInteger id) {
		this.id = id;
	}

	public User getUserId() {
		return userId;
	}

	public void setUserId(User userId) {
		this.userId = userId;
	}


	public BigInteger getOpType() {
		return opType;
	}

	public void setOpType(BigInteger opType) {
		this.opType = opType;
	}

	public Date getOpTime() {
		return opTime;
	}

	public void setOpTime(Date opTime) {
		this.opTime = opTime;
	}

	public BigInteger getDeliveryNum() {
		return deliveryNum;
	}

	public void setDeliveryNum(BigInteger deliveryNum) {
		this.deliveryNum = deliveryNum;
	}

	public Date getDeliveryTime() {
		return deliveryTime;
	}

	public void setDeliveryTime(Date deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
}
